





use with dataset: "PNASSubset.dta" , clear



***recodes replacing missing values as non-voters in both surveys

gen newvoting=.
replace newvoting=0 if voting==0
replace newvoting=1 if voting==1
replace newvoting=0 if missing(newvoting) 
sum newvoting voting

gen sumccednew=.
replace sumccednew=sumcced123 if sumpdiss >=1

sum sumcced123 sumccednew sumlmds4 sumomds4 sumnmds4 if sumpdiss>=1

gen ploplsdiff=.
replace ploplsdiff=pls-plo

***Figure 1, Network size by year, by mode and excluding those with 0 discussants

ttest sumpdiss, by(year01) 
ttest sumpdiss, by(year01), if phone==1
ttest sumpdiss, by(year01), if sumpdiss >=1 
ttest sumpdiss, by(year01), if sumpdiss >=1 & phone==1


***Figure 2
***Index of CCE and numbers of three types of discussants (LM: like-minded, OM: opposition-minded and NM: neutral)

ttest sumccednew, by(year01)
ttest sumomds4, by(year01)
ttest sumlmds4, by(year01), if sumpdiss >=1
ttest sumnmds4, by(year01)


***Figure 3

table sumpdiss, statistic(mean sumlmds4 sumomds4 sumnmds4), if year01==0 & sumpdiss >0
table sumpdiss, statistic(mean sumlmds4 sumomds4 sumnmds4), if year01==1 & sumpdiss >0


***Figure 4 and Figure 5: diffs by year in plo pls and difference, plus tolerance

ttest plo, by(year01) 
ttest pls, by(year01) 
ttest ploplsdiff, by(year01) 
ttest tolerance, by(year01) 
ttest plocandidate, by(year01)
ttest plscandidate, by(year01)


***Figure 6 and Table S3

regress plsplodiff c.sumccednew##year01 c.educ5##year01 c.age4##year01 rep##year01 dem##year01 gender##year01 c.newincome##year01 white##year01 c.sumpdiss##year01
margins year01, at(sumccednew=(-3(1)3))
marginsplot


**Figure 7 and Table S4
***index impact is same by year on voting

logit newvoting c.sumccednew##i.year01 c.educ5##i.year01 c.age4##i.year01 rep##i.year01 dem##i.year01 gender##i.year01 c.newincome##i.year01 white##i.year01 c.sumpdiss##i.year01
margins year01, at(sumccednew=(-3(.5)3))
marginsplot,  recast(line) recastci(rarea)

***separate components impact of only lmd

logit newvoting c.sumomds4##i.year01 c.sumlmds4##i.year01 c.sumnmds4##i.year01 c.educ5##i.year01 c.age4##i.year01 rep##i.year01 dem##i.year01 gender##i.year01 c.newincome##i.year01 white##i.year01 c.sumpdiss##i.year01
margins year01, at(sumlmds4=(0(.5)3))
marginsplot, recast(line) recastci(rarea)


****Table S1: demographic changes over time
**age

table age4, statistic(mean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==0
table age4, statistic(semean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==0

table age4, statistic(mean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==1
table age4, statistic(semean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==1

***educ5

table educ5, statistic(mean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==0
table educ5, statistic(semean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==0

table educ5, statistic(mean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==1
table educ5, statistic(semean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==1

***gender

table gender, statistic(mean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==0
table gender, statistic(semean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==0

table gender, statistic(mean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==1
table gender, statistic(semean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==1

***race

table white, statistic(mean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==0
table white, statistic(semean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==0

table white, statistic(mean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==1
table white, statistic(semean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==1

**income

table newincome, statistic(mean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==0
table newincome, statistic(semean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==0

table newincome, statistic(mean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==1
table newincome, statistic(semean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==1

**D/indep/R

table pid3, statistic(mean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==0
table pid3, statistic(semean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==0

table pid3, statistic(mean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==1
table pid3, statistic(semean sumccednew sumlmds4 sumomds4 sumnmds4), if year01==1


***Table S2: DV=Tolerance, pooled regression analyses, CCD and LMD, OMD, NMD predicting tolerance
***tolerance predicts identically in both years

regress tolerance c.sumccednew c.educ5 c.age4 c.rep c.dem c.gender c.newincome i.white i.year01 sumpdiss
margins year01, at(sumccednew=(-3(1)3))
marginsplot


regress tolerance c.sumccednew##year01 c.educ5##year01 c.age4##year01 c.rep##year01 c.dem##year01 c.gender##year01 c.newincome##year01 i.white##year01 i.year01 
margins year01, at(sumccednew=(-3(1)3))
marginsplot


***what matters to tolerance is like-minded exposure 

regress tolerance sumomds4 sumlmds4 sumnmds4 educ5 age4 rep dem gender newincome white i.year01 sumpdiss
margins, at(sumlmds4=(0(1)3)) 
marginsplot


regress tolerance sumccednew educ5 age4 rep dem gender##year01 newincome white i.year01 sumpdiss
margins, at(sumccednew=(-3(.5)3)) 
marginsplot

***Table S5


regress participation6 sumccednew educ5 age4 rep dem gender newincome white sumpdiss 

regress participation6 sumomds4 sumlmds4 sumnmds4 educ5 age4 rep dem gender newincome white sumpdiss
test sumomds4 sumlmds4 sumnmds4
margins, at(sumlmds4=(0(.5)3))
marginsplot
 
 

 
 
 ***END
 
 
 